<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="service.*" %>
<%@ page import="vo.*" %>
<%@ page import="po.*" %>
<%@ page import="java.util.*" %>

<%
	MessageService ms = new MessageServiceImpl();
	
	String title = (String) request.getParameter("title");
	String content = (String) request.getParameter("content");
	int type = Integer.parseInt((String) request.getParameter("type"));
	boolean secret = Boolean.parseBoolean((String) request.getParameter("secret"));
	String password = (String) request.getParameter("password");
	
	Message nm = new Message("", title, content, type, false, new java.util.Date(), secret, password, "");
	nm = ms.newMessage(nm);
	String no = (nm == null) ? "0" : nm.getNo();
	out.println("{'no':'" + no + "'}");
%>